/*
 * @Date: 2024-11-19 11:32:34
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-11-19 11:32:34
 * @Description: 通用附件接口集合 
 */

import { defAxios as request } from '@/utils/http';

export * from './files-szys';
export * from './files-zjps';

export function useFilesApi() {
	return {
		uploadFileRuleData(params) {
			return request({
				url: '/uploadFile/rule',
				method: 'post',
				data: params,
			});
		},
		delUploadFileData(fileId) {
			return request({
				url: `/uploadFile/delete/${fileId}`,
				method: 'post',
				data: {},
			});
		},
		previewFileData(fileId) {
			return request({
				url: `/uploadFile/preview/${fileId}`,
				method: 'post',
				timeout: 0,
				responseType: 'blob',
			});
		},
		/**
		 * 下载文件
		 * @returns Proxy
		 */
		downloadFileData(fileId) {
			return request({
				url: `/uploadFile/download/${fileId}`,
				method: 'post',
				timeout: 0,
				responseType: 'blob',
			});
		},
		getAllUploadFiles(params) {
			return request({
				url: '/uploadFile/list',
				method: 'post',
				data: params,
			});
		},
		/**
		 * 
		 * @param {*} 评分标准设置树形接口 
		 * @returns 
		 */
		getPdfzList(params) {
			return request({
				url: '/ZqglPfbz/getPfbzTreeList',
				method: 'post',
				data: params,
			});
		},
	};
}
